home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 6: Level 6
/
17 Bit - Level 6 (1998)(Epic Marketing)[!].iso
/
!applications!
/
azspell_2.02
/
azspell.doc
< prev
next >
Wrap
Text File
|
1996-09-07
|
21KB
|
487 lines
AZSPELL V2.02
-------------
The Amiga spelling checker
--------------------------
by
Danny Hartley
Copyright © D.J.H.Hartley, 1990-1993.
AZspell and AZmerge can be used and distributed freely, but they are not
public domain. The author retains copyright. They may not be sold for
profit, or included with any commercial product without prior permission
from the author. This document must be supplied with the programs and
must not be modified.
AZdictionary is supplied `as is' for public domain, and may be modified
and redistributed in a modified form - no guarantee is expressed or
implied as to the correctness of the words contained in the file.
AZspell and AZmerge were written in 68000 assembly language using the
excellent HiSoft Devpac2 assembler.
Many thanks go to Dave Buckner of Glasgow, who added another 9000 words
to the dictionary and removed a lot of errors and spellings that aren't
used much this side of the Atlantic. He has also included both Scottish
and English versions where there's a difference, e.g. burgh and borough,
bailie and alderman.
The files supplied are:
AZspell.doc - The instructions (this file)
AZspell - The spelling checker program (V2.02)
AZmerge - The dictionary update program (V2.02)
AZassign - A script to assign AZspell:
AZconfig - A configuration file
AZdictionary - The dictionary
and their associated icons (.info files)
If you, like me, have great problems with spelling and/or your typing
fingers tend to hit every key except the one that your brain told
them to hit, then this is the program for you. A quick and simple to
use spelling checker.
All the files supplied have icons attached so that they may be
moved from volume to volume from the Workbench screen.
When a document is checked, words that cannot be found in the
dictionary can be simply added to the dictionary so that they are
remembered for the next time. The program uses an intermediate file
called AZupdate to allow you to check the words, should you need to,
before committing them to the main dictionary. The intermediate file
also has several more uses (see AZmerge and AZspell:Special Mode).
V2.00 QUICK INFO
----------------
AZspell has been completely revamped for V2.00 although is still similar
to previous versions. Notable differences are the inclusion of a friendly
file requester, word character set definition via a configuration file
and of course WB2 style clicky bits.
Installing the speller
----------------------
For the speller to be most useful, that is, to allow words to be
added to the dictionary, it is best installing it onto a separate
disc. Installation is very simple.
If you require the speller to be kept on its own disc, then format
a disc (initialize it), and rename it to AZspell. Once you have done that
then copy the files AZspell, AZmerge, AZconfig and AZdictionary onto the
disc (by dragging the icons from this drawer onto the new disc). As the
disc is called AZspell the program AZassign is not needed.
If you require the speller to be in a drawer on part of a disc, as
you would for a hard disc, then create the drawer for it (dragging
Empty from a Workbench disc would do), and copy the files AZspell,
AZmerge, AZassign, AZconfig and AZdictionary into the drawer. AZassign
has to be in the same drawer that AZconfig and AZdictionary are in,
AZspell and AZmerge could in fact be anywhere you choose to place them
(except the bin!).
If you use AZassign then you will also need the following
Workbench V1.3 (or V2.0) commands (in the C: directory) :
Run, FailAt, Execute, CD, IconX, Assign and Echo.
AZassign
--------
To allow maximum flexibility of speller configuration, i.e. where it
is - from its own separate floppy disc to a directory on a hard disc,
the speller uses a logical device name of "AZspell:" to store the
configuration, dictionary and update files on. If the speller resides on
its own disc with a volume name of AZspell then you can ignore this
program. If not then copy AZassign along with AZspell, AZmerge, AZconfig
and AZdictionary to the drawer where you wish the speller to be.
Whenever you need to use AZspell or AZmerge then run AZassign first
by double clicking on the AZassign icon. After AZassign has run then
whenever you run AZspell or AZmerge they will be able to find the
dictionary.
NOTE: AZassign only has to be run once and of course after
the Amiga has been reset/turned off etc.
AZassign will only work correctly if used from the Workbench. If
you are running the speller from the CLI/Shell then you will have to
assign AZspell: manually, e.g.:
Assign AZspell: dh2:wp/speller
Or CD to the directory and Execute AZassign from there.
AZspell
-------
AZspell is the spelling checker program. To run it just double click
on its icon. Once it has loaded the dictionary, a file requester window
appears and prompts for a document name. The requester operates in a
similar manner to the ARP requester. Even if you're not familiar with ARP,
using the AZspell requester should be obvious. Just click on the name of
the file you require and click `OK'. Double clicking on the file provides
a short-cut. The right mouse button brings up a list of devices, volumes
and logical devices. Double clicking the right mouse has the same effect
as clicking `Cancel'.
Alternatively, AZspell and the file can be loaded by using Extended
Selection. Click once on the file's icon and while pressing the Shift key
double click on AZspell.
If the file could not be found or could not be loaded an error message
is displayed along with an AmigaDOS error code, to allow you decide what
exactly is wrong.
The main part of the program is the checking window. It consists of
several sections.
The first section is the word statistics. It displays the number of
words in the dictionary and document (file). How many words have been
checked so far, how many were not found and how many are only used once.
Please note, to make the checker check words quickly and only stop at
words it cannot find, the last three stats are only refreshed whenever
the program has to wait for a response from the user (you).
Underneath the stats is a correction box that allows you to type in
a new word whenever a word cannot be found.
At the bottom is a line from the document with the current word being
checked highlighted in the centre.
On the right hand side is a suggestions box. When a word can't be found
then a list of thirty closest possible words is generated. The list takes
words from the dictionary (including words added) and any from the words
ignored (they are remembered). This process may take several seconds to
complete. When the list has been compiled the words are listed in order
from the closest word at the top. To move the list up and down use `Up'
and `Do' respectively. Usually the word you are looking for will be in the
top few. If you wish to use one of the words from the list of suggestions
then just click on the word. It will then be copied into the correction
box, to allow it to be used for correction.
A valid word (one that will be checked) is defined as a character or
sequence of characters, the initial character must be alphabetic, the
remaining characters can be alphabetic, an apostrophe or a hyphen except
the final character which must only be alphabetic.
This definition, however, can be changed by modifying the configuration
file. The creation of the configuration file and its uses is fully
described in the section AZconfig.
Anything that is not a valid word is not checked by the program.
The final section is the four boxes in the middle. These instruct the
program what to do when it can't find a word.
Add to dictionary - If the highlighted word in the document is not
already in the dictionary then it will be added
to the dictionary (via AZupdate).
Ignore word - Ignores the highlighted word but remembers it.
If you ignore a word then any further occurrences
of the word will also be ignored.
Correct word - Corrects the word with the word(s)/characters in
the correction box. If the correction box contains
a single valid word that is not already in the
dictionary then it will be remembered.
Correct word also has another mode. If the
correction box is empty then the word will be
completely ignored and not remembered.
Correct and Add - As Correct word but the correction box must only
contain a single valid word. If the word is not
already in the dictionary then it will be added
to the dictionary (via AZupdate).
The spelling checker can be stopped before all the words have been
checked by clicking on the close gadget.
When all the words have been checked (or you have stopped the speller
part way through) and words in the document have been corrected then the
file requester appears asking you for the name to save the document under.
If words have been added to the dictionary then the words are saved
to the file AZspell:AZupdate.
If you click on `Cancel' when asked for the name to save the document
as, then the document save AND the AZupdate save will both be aborted.
Special Mode
AZspell has a special mode that allows the automatic collection of
misspelled/not found words in a document. This mode is only available
from the CLI/Shell as normally the machine would be left unattended,
controlled from a script. The command line format is:
AZSPELL [<file> [!]]
If the file name <file> is not specified then AZspell behaves as
normal just as if you had run it from the Workbench. If <file> is given
then it is loaded but otherwise nothing different. If a ! is given after
the file name, then the file is loaded, the checking window appears, but
if a word can't be found then it is automatically added to the dictionary
just as if you had clicked in the `Add to dictionary' box. When AZspell
has finished the file AZupdate can be examined to find any suitable words
to add to the dictionary. In this way a large and thorough dictionary can
be easily built up.
If you do use this on a lot of documents and leave your Amiga running
while you watch Neighbours, then the script below should provide a
suitable starting point.
echo >ram:fried_egg "** file1 **"
azspell file1 !
join ram:fried_egg azspell:azupdate to ram:spam
echo >>ram:spam "** file2 **"
azspell file2 !
join ram:spam azspell:azupdate to ram:fried_egg
echo >>ram:fried_egg "** file3 **"
azspell file3 !
join ram:fried_egg azspell:azupdate to ram:spam
and so on...
AZmerge
-------
This program merges the words in AZupdate with the main dictionary
AZdictionary. After checking a document and you are sure that the words
that you have added to the dictionary (using Add to dictionary/Correct
and Add) are all correct then run this program by double clicking on
its icon or from the CLI/Shell. A window will appear to inform you
that it is running.
If you wish to add many words to the dictionary and don't want to
go through AZspell clicking `Add to dictionary' all the time, then
using your favourite text editor, create a file of words and save it
as AZspell:AZupdate. There must only one word per line, each word
conforming to the previously mentioned definition of a word. The case
is unimportant unless the case sensitive option is used and the file
does not need to be sorted.
Once AZupdate has been created then run AZmerge. Any words that are
already in the dictionary will be ignored, similarly if a word occurs
two or more times then only one occurrence will be used. This feature
could be used to join another dictionary with the main one.
AZmerge V2.00 has been extensively re-engineered and consequently is
considerably faster than its predecessors.
AZconfig
--------
A new addition with AZspell V2.00 is the ability for the user to set up
the speller with particular preferences. This was available on AZspell
V1.1x to a degree but not as definitive.
The configuration is defined as a set of commands in a text file
AZspell:AZconfig. This configuration file is used by both AZspell and
AZmerge. Each command consists of a single character command word in
the FIRST COLUMN of a line. The case of the character is important.
If AZconfig does not exist, AZspell and AZmerge revert to a default
setting suitable for English. If this is all you require then you can
delete AZconfig. There is no speed penalty for using or not using
AZconfig other than time required to load it from disc.
The default setting of AZspell and AZmerge is:
G 2
H ABCDEFGHIJKLMNOPQRSTUVWXYZ
M ABCDEFGHIJKLMNOPQRSTUVWXYZ-'
T ABCDEFGHIJKLMNOPQRSTUVWXYZ
G COMMAND
A G command defines the graphics/gadgets style. Its purpose is to modify
the look of AZspell depending upon your mood etc. Currently four styles
are available:
0 : Traditional olde-Workbenche gadgets
1 : As 0 but word highlight is modified for working in 2-colours
2 : Bas-relief graphics for usual WB1.x palette (default)
3 : Bas-relief graphics for usual WB2.0 palette
The format of the command is:
G <style>
Where <style> is one of the above numbers. It can occur anyway in the
config file but only the first occurrence will have the effect.
H,M AND T COMMANDS
These commands define the valid characters for Head, Middle and Tail
character sets respectively.
The format of the commands are:
H {<ch>}
M {<ch>}
T {<ch>}
Where <ch> is a character and {..} means zero or more. They may occur
anywhere (but see the C command) and in any order. If there are several
occurrences of a command it will have the effect of adding to the
previously defined sets. They will not reset or undo any previous
definition. The order and case of any alphabetic characters used, whether
A-Z or any of the international characters is unimportant (but see C
command), i.e.:
H ABCDEFGHIJKLMNOPQRSTUVWXYZ
Is the same as:
H TheQuickBrownFoxJumpsOverTheLazyDog
AZspell knows about upper case and lower case letters used by foreign
(not English) languages. For example, a definition for Norwegian is:
H ABCDEFGHIJKLMNOPQRSTUVWXYZÆÅØ
M ABCDEFGHIJKLMNOPQRSTUVWXYZ-'ÆÅØ
T ABCDEFGHIJKLMNOPQRSTUVWXYZÆÅØ
Don't forget to distribute AZconfig with AZdictionary if distributing
a dictionary that doesn't use the default setting for AZspell.
Note: the default setting is different to pre-V2.00 versions. The
hyphen and apostrophe are now not allowed to form ends of words. If you
find that your pre-V2.00 dictionary is now incompatible either change
AZconfig to the definition below or delete the offending lines from the
dictionary - AZspell will tell you where the errors are.
The equivalent pre-V2.00 AZspell setting is:
H ABCDEFGHIJKLMNOPQRSTUVWXYZ
M ABCDEFGHIJKLMNOPQRSTUVWXYZ-'
T ABCDEFGHIJKLMNOPQRSTUVWXYZ-'
For those of you with unusual spelling requirements, the character
set definition will allow any ASCII character, even control codes, with
exceptions being ^@ ($00), ^A ($01) and ^J ($0A). In the past, people
have asked for a speller to check their BASIC programs, where a single
misspelled variable is hard to find as variables don't require declaring
in BASIC. AZconfig will allow definition of a variable name followed by
%, $, # etc. or a letter followed by zero or more letters or numbers.
You get the picture. AZdictionary would contain the keywords of the
language e.g. PRINT, GOTO etc. A working copy of AZdictionary can then
be used for storing variable names etc. while the program is being
developed.
If you require a space to be part of a valid word (!) then delimit
the letters by double quotes, e.g.:
M " ABC*"**"
defines a middle letter as a space,A,B,C,a,b,c," or *.
Finally, how these definitions are used by AZspell to determine a
valid word.
A word must start with a character from the Head set. It may then
contain zero or more characters from the Middle set and may terminate
with a character from the Tail set. Depending upon your definitions of
the sets, if, after finding a head character, the speller finds a
character that is not in the Middle set nor in the Tail set, then it will
backtrack through the word until it finds a character that is in the
Tail set, in which case this will be the end of the word, or reaches the
character used as the head of the word, in which just only the head
character will form the word.
Note if AZconfig is used then character set definitions are expected.
That is, if you use AZconfig then these three commands should be used to
explicitly define the character set you require.
E COMMAND
The E command defines the a set of characters that are, ASCII wise,
different but are to be treated as equivalents. The speller uses this
information to provide an improved list of possible suggestions.
The format of the command is:
E {<ch>}
Where <ch> is a character and {..} means zero or more. The command may
occur anywhere (but see the C command). A complete set is defined using a
single command. Once a character belongs to an equivalent set then cannot
be used for another equivalent set. The order and case of any alphabetic
characters used, whether A-Z or any of the international characters is
unimportant (but see C command). Example:
E AÁÀÄ
defines an equivalent set containing A,a,Á,á,À,à,Ä and ä.
COMMENTS
Comment lines may be introduced by an asterisk in the first column.
The remainder of the line is then ignored. Also blank lines are skipped.
*comments are jolly useful things
C COMMAND
A C command defines that the dictionary and all spell checking is case
sensitive (for checking C programs?).
The format of the command is:
C
The position of the command is important. If a H,M,T or E command
occurs before the C then the checking, using that set of letters, includes
both upper case and lower case. Any H,M,T or E after the C will check
letters using the case of each letter specified in the command. Experiment
if it is a bit cloudy.
AZdictionary
------------
This is the actual dictionary that AZspell uses to determine if a
word is correct or not, or isn't in the dictionary. The dictionary has
currently about 22000 words which is hardly the whole English language
but does contain the most used words, so should be good for most of the
time unless you use very exotic words a lot. I should like to point out
that even though I have personally checked the whole dictionary, a task
only slightly more interesting than watching paint dry, the odd word or
two may have slipped past my bleary eyes, so I make no claim that the
dictionary is 100% correct.
** YOU HAVE BEEN WARNED **
You should always have a dictionary close to hand in any case.
The dictionary is purely a simple text file, and can be viewed (and
edited) with any text editor. All the words conform to the previously
mentioned definition of a word. They are all in upper case (unless the
case sensitive option is used) with one word per line and in strict
ASCII ascending order. If you decide to edit the dictionary then ensure
that the above is still true, particularly ensure there are no empty
lines, especially at the end of the file.
Any queries, suggestions, spare cash, beer, etc. to:
Danny Hartley
1 Alexandra Drive
Prestatyn
Clwyd
LL19 8BW
U.K.